<template>
  <div class="hello">
    <h1>填写表格</h1>
    姓名：<input v-model.trim="username" type="text" /><br />
    性别：
    <input type="radio" id="one" value="男" v-model="picked" />
    <label for="one">男</label>
    <input type="radio" id="two" value="女" v-model="picked" />
    <label for="two">女</label>
    <br />

    <button @click="fn">提交</button>
  </div>
</template>

<script>
import {EventBus} from "../utils/eventBus"

export default {
  data() {
    return {
      msg: 123,
      username: "",
      picked:""
    };
  },
  props: {},
  methods:{
    fn(){
      EventBus.$emit("username",this.username)
      EventBus.$emit("picked",this.picked)
    }
  }
};
</script>

<style scoped>
.hello {
  width: 50%;
  height: 100vh;
  background-color: aqua;
}
</style>
